<include file="Core:Public:header" />
<link rel="stylesheet" href="__PUBLIC__/css/treeview/jquery.treeview.css" type="text/css">
<script type="text/javascript" src="__PUBLIC__/js/treeview/jquery.treeview.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/treeview/jquery.treeview.edit.js"></script>
<script src="__PUBLIC__/js/datepicker/WdatePicker.js"></script>
<script type="text/javascript">
	$(function() {
		$("#browser").treeview();
	})
</script>
<style type="text/css">
.ztree li span.button.add {margin-left:2px; margin-right: -1px; background-position:-144px 0; vertical-align:top; *vertical-align:middle}
.dltable{width:100%;height:750px;background-color:#d8e8f8;}
.dllist{width:400px;height:500px;float:left;border:1px solid #9eb5ce;background-color:#eef4fb;}
.dt1{float:left;width:100%;
border-bottom:1px solid #d9e1e9;text-align:center;font-size:15px;line-height:50px;background-color:#B9D3EE;}
.dd1{float:left;width:100%;height:60px;padding-top:10px;padding-left:10px;border-bottom:1px solid #d9e1e9;line-height:30px;}
.tsubmit{
width:70px;height:30px;background-color:#0789cc;border:hidden;
-moz-box-shadow: 2px 2px 1px #909090;
-webkit-box-shadow: 2px 2px 1px #909090;
box-shadow:2px 2px 1px #909090;
border-radius:10px;
font-family:黑体;
font-size:15px;
color:white;
text-align:center;
}
.tsubmit:hover{
	background-color:#055680;
}
.desc{
	width:100%;height:100;border:1px;float:left;
}
.desc li{
	list-style:none;
	line-height:30px;
	font-weight:bold;
}
.dd1 input:disabled{
	background-color:#ffffff;
	text-align:center;
}
</style>
{:W('Navigation')}
<div class="body-right">
	<div class="row-table">
		<div class="row-table-title"><a href="javascript:history.back()"><<返回</a>支出修改</div>
	</div>
<form action="{:U('chrm/turnover/expend_update2')}" onsubmit="return validate_form(this)" method="post">
	<input type="hidden" name="total_id" value="{$list.total.total_id}"/>
<?php $bai=100/count($list['type']);?>
	<div class="dltable">
		<div class="desc">
				<li>总金额：{$list.total.money_sum} &nbsp;(元)</li>
				<li>添加时间：{$list.total.add_time|date="Y/m/d H:i",###}</li>
		</div>	
		<div class="form-group col-sm-2" style="margin-bottom:-10px;margin-top:20px;">

				    	<label for="name">团队选择：</label>

				    		<select name="dep" class="form-control">
								<option value="{$list.total.dep}" select="selected">{$list.total.department.name}</option>
				    			<option value="">请选择团队</option>
				    			<volist name="dep" id="vo">
				    				
				    				<option value="{$vo.department_id}">{$vo.name}</option>

				    			</volist>

				    		</select>
				    		<label for="name" style="margin-left:20px;">支出日期：</label>
				    		<input type="text" name="tdate" class="form-control" onclick="WdatePicker({dateFmt:'yyyy-MM-dd H:00'})" value="{$list.total.total_date|date="Y/m/d",###}" style="width:200px;"/>
				    	

		</div>
				
		
		<volist name="list['type']" id="v">
			<dl class="dllist" style="width:{$bai}%;">
				<dt class="dt1">{$v.name}</dt>

				<volist name="v['power']" id="vo">
					<dd class="dd1" >{$vo.name}:<input type="text" name="{$vo.tid}" value="{$list['money'][$key].money}" size="8"/></dd>
				</volist>

			</dl>
		</volist>
		
		<div style="width:100%;height:100;border:1px;">
				备注：
				<textarea name="desc" cols="235" rows="3">{$list.total.desc}</textarea>
		</div>
		<div style="text-align:center;margin-top:10px;">
			<input type="submit" value="提交"  class="tsubmit"/>
		</div>
	</div>
	
</form>		
	
	
</div>
<div class="clear"></div>
<script type="text/javascript">
function validate_name(dep,str){
	with(dep)
	{
		if(value==null || value=="")
		{alert(str);return false;}
		else{	return true;}
	}
}

	function validate_form(thisform){
		with(thisform)
		{
			if(validate_name(dep,"请选择团队")==false){
				dep.focus();return false;
			}
			if(validate_name(expend_date,"请输入支出日期")==false){
				expend_date.focus();return false;
			}

		}
	}
</script>

<include file="Core:Public:alert" />
<include file="Core:Public:footer" />